
import 'package:yd_eval/entity/yd_api_eval_result_entity.dart';
import 'package:yd_eval/manager/yd_eval_manager.dart';

/// 评测结果实体
class YDEvalResultEntity {
  /// 录音文件路径
  late String path;
  /// 评测结果 xml 格式
  late String result;
  /// 评测结果 转换后的
  YdApiEvalResultEntity? resultEntity;
  /// 转换前的base64字符
  String? resultBase64;
  /// 当前事件类型
  YDEvalEventType type;
  /// toast 文本
  String? toastText;
  /// 原文
  String? originText;
  /// 错误码
  int? errorCode;
  /// 评测类型
  String evalType;

  YDEvalResultEntity({
    required this.path,
    required this.result,
    required this.type,
    this.resultEntity,
    this.toastText,
    this.originText,
    this.errorCode,
    this.resultBase64,
    this.evalType = YdEvalType.TYPE_EN,
  });
}

/// 当前事件类型
enum YDEvalEventType{

  /// 开始录音
  startRecord,

  /// 结束录音
  endRecord,

  /// 评测结果
  evalResult,

  /// 评测进度
  evalProgress,

  /// 错误情况
  error,

  /// toast
  toast,

  /// 没有检测到说话 超时 前置超时
  timeout,

  /// 取消
  close,


}